﻿//*** Guidance generated code ***//
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;

namespace ProjectBase.Core.Web
{
    public enum Align
    {
        left,
        center,
        right
    }

    /// <summary>
    ///     CellDescription should contain detail information 
    ///     for UI Writer. There are switches for deciding to Localize, Sort, SortBy
    ///     and HeaderName
    /// </summary>
    public interface ICellDescription
    {
        /// <summary>
        ///     If false, row HeaderName is Rendered. True(default) will try to localize
        /// </summary>
        bool Localize { get; set; }

        /// <summary>
        ///     If True(default) then UI will try to append Sorting navigation to that HeaderName
        /// </summary>
        bool Sort { get; set; }

        /// <summary>
        ///     The name of the property (e.g. "Code") to be used for filtering.
        ///     It could be also an object tree with nested objects (e.g. Article.User.Login)
        /// </summary>
        string SortProperty { get; set; }

        /// <summary>
        ///     The phrase to be rendered or (before) localized
        /// </summary>
        string HeaderName { get; set; }

        /// <summary>
        ///     The Area for filtering localization. 
        ///     If left empty, then UI can use its 'current' area 
        ///     (which could lead to 'mishmash')
        /// </summary>
        string HeaderNameArea { get; set; }

        /// <summary>
        ///     The Value of current column which should be displayed
        /// </summary>
        string Value { get; set; }

        /// <summary>
        ///     If IsEmpty() Value is returned. Is used for title attribute of TD element
        /// </summary>
        string Title { get; set; }

        /// <summary>
        ///     Cells in the column are limited in the string length to the provided value.
        ///     Default is 25
        /// </summary>
        int MaxCellLength { get; set; }

        /// <summary>
        ///     If set to true, cells in the column are aligned to the right
        /// </summary>
        Align Align { get; set; }

        /// <summary>
        ///     If set to true, fields are displayed as Checkboxes, 
        ///     and expected Value must contain "False" or "True". Default is false
        /// </summary>
        bool IsBoolean { get; set; }

        /// <summary>
        ///     Could be used as the formating string for the ToDisplay() call.
        ///     (for instance used when the Expression like 'entity.Property' is passed into the extension 'Cell()')
        /// </summary>
        string Format { get; set; }
    }
}